﻿<Window x:Class="GeometryViz3D.Views.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:cp="http://schemas.charlespetzold.com/2007/xaml"
    xmlns:local="clr-namespace:GeometryViz3D"
    xmlns:localview="clr-namespace:GeometryViz3D.Views"
        xmlns:localmodel="clr-namespace:GeometryViz3D.Model"
    Title="Geometry 3D" MinHeight="500" MinWidth="600" Loaded="Window_Loaded" WindowState="Maximized" SizeChanged="Window_SizeChanged" ResizeMode="CanResize" WindowStyle="ThreeDBorderWindow">
    <Window.Resources>
        <DataTemplate x:Key="endPointComboBoxItemTemplate">
            <TextBlock Text="{Binding}" />
        </DataTemplate>
    </Window.Resources>
    <DockPanel LastChildFill ="True" Name ="panel">
        <Menu Height="22" Name="MainMenu" VerticalAlignment="Top" DockPanel.Dock="Top">
            <MenuItem Header="File">
                <MenuItem Header="New Model..." Command="{Binding NewModelCommand}" Name="menuItemNew" />
                <MenuItem Header="Open Model..." Command="{Binding OpenModelCommand}" Name="menuItemOpen" />
                <MenuItem Header="Save Model" Command="{Binding SaveModelCommand}" Name="menuItemSave" />
                <MenuItem Header="Save Model As..." Command="{Binding SaveAsModelCommand}" Name="menuItemSaveAs" />
                <Separator />
                <MenuItem Header="Recent Models" Name="menuItemRecentModels" />
                <Separator />
                <MenuItem Header="Exit" Command="{Binding ExitCommand}" Name="menuItemExit" />
            </MenuItem>
            <MenuItem Header="Model">
                <MenuItem Header="Add Point..." Name="menuItemAddPoint" Command="{Binding AddPointCommand}" />
                <MenuItem Header="Add Line..." Name="menuItemAddLine" Command="{Binding AddLineCommand}" />
                <Separator />
                <!--
                <MenuItem Header="Edit Model..." Name="menuItemEditModel" Command="{Binding EditModelCommand}" />
                -->
            </MenuItem>
            <MenuItem Header="View">
                <MenuItem Header="Show Control Panel" Name="menuItemShowControlPanel" Click="ShowControlPanel_Click" />
            </MenuItem>
        </Menu>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition MinWidth="200" Width="300"/>
                <ColumnDefinition Width="5" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            
            <DockPanel Grid.Column="0"  >
                <localview:ModelEditor DataContext="{Binding ModelEditorViewModel}"/>
            </DockPanel>

            <GridSplitter Grid.Column="1" HorizontalAlignment="Center" 
                          VerticalAlignment="Stretch"
                          Width="5" 
                          ShowsPreview="True"/>
            
            <localview:G3DViewport Grid.Column="2" x:Name="viewport" Width="Auto" Height="Auto" Margin="1, 1, 1, 1" />
        </Grid>
    </DockPanel>
</Window>
